package com.atjinggu.jinggumail.ware.dao;

import com.atjinggu.jinggumail.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author jingming
 * @email jingming@gmail.com
 * @date 2020-12-13 12:27:45
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    void addStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);

    List<Long> getWareIdbySkuId(@Param("skuId") String skuId);

    int lockSkuStock(@Param("wareId") Long wareId, @Param("skuId") Long skuId, @Param("num") Integer num);

    void unLockStockLocked(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);

}
